package com.qiangou.controller;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.entity.AdvMes;
import com.qiangou.service.AdvMesService;

/**
 * 将表里面的数据渲染到前端页面
 * 
 * @author Administrator
 * 
 */
@Controller
@RequestMapping("/test")
public class ShowController {

	@Resource(name = "AdvMesService")
	private AdvMesService AdvMesService;

	@RequestMapping("/AdvMesService")
	public ModelAndView AdvMesService(AdvMes  am) {
		
		//AdvMes  am =new  AdvMes();
		ModelAndView mv = new ModelAndView();
		mv.setViewName("show1");
		//AdvMes am = new AdvMes();

		// List<AdvMes> list=new ArrayList<AdvMes>();
		List<AdvMes> advmes = AdvMesService.findAllAdvMes(am);

		// mv.addObject("time", new Date());
		mv.addObject("advmes", advmes);

		return mv;

	}

}
